<template>
  <div>
    <h2>子组件</h2>
    <p>子组件玩具: {{ toy }}</p>
    <button @click="handleSend">给父组件传递玩具值</button>
  </div>
</template>

<script lang="ts" setup>
// getToy
import { ref } from 'vue'

const emit = defineEmits(['send-toy'])
let toy = ref('atm')
function handleSend(){  
  emit('send-toy', toy.value)
}
</script>

<style lang="scss" scoped>
</style>
